package com.hdu.dwh.service;

import java.sql.SQLException;
import java.util.List;
import java.util.Set;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.hdu.dwh.dtos.model_dtos.BuildModelDto;
import com.hdu.dwh.dtos.model_dtos.ModelCreateDto;
import com.hdu.dwh.dtos.model_dtos.PreviewModelDto;
import com.hdu.dwh.pojos.FlinkJob;
import com.hdu.dwh.pojos.Model;
import com.hdu.dwh.pojos.QueryResult;
import com.hdu.dwh.pojos.model_pojos.MetaTable;
import com.hdu.dwh.pojos.source_access_pojos.DataWarehouseTable;
import com.hdu.dwh.pojos.source_access_pojos.IColumn;
import com.hdu.dwh.vos.ModelVo;

public interface ModelService extends IService<Model> {
    public Page<ModelVo> queryModelVoPage(int page, int size);

    public List<ModelVo> queryModelVoList();
    
    public ModelVo queryModelVoById(Integer id);

    public ModelVo createModel(ModelCreateDto modelCreateDto) throws Exception;

    public void deleteModel(Integer modelId) throws Exception;

    public void updateModel(ModelCreateDto modelCreateDto, Long modelId);

    public FlinkJob buildModel(BuildModelDto buildCubeDto) throws Exception;

    FlinkJob createDimensionTable(DataWarehouseTable sourceTable, Set<IColumn> columns,
            String dimensionTableName, String description, Long databaseId) throws SQLException;

    QueryResult previewModel(PreviewModelDto previewModelDto) throws Exception;

    QueryResult previewDimTable(MetaTable metaTable) throws Exception;

    public void deleteModelByTableId(Long tableId);

}
